package com.fac.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable;

/**
 * 创建设备分类DTO
 */
@Data
@ApiModel(description = "创建设备分类请求参数")
public class CategoryCreateDTO implements Serializable {

    /**
     * 父分类ID
     */
    @NotNull(message = "父分类ID不能为空")
    @Min(value = 0, message = "父分类ID必须大于等于0")
    @ApiModelProperty(value = "父分类ID", example = "0", notes = "顶级分类的父ID为0", required = true)
    private Long parentId;

    /**
     * 编码
     */
    @NotBlank(message = "分类编码不能为空")
    @ApiModelProperty(value = "分类编码", example = "CAT001", required = true)
    private String code;

    /**
     * 名称
     */
    @NotBlank(message = "分类名称不能为空")
    @ApiModelProperty(value = "分类名称", example = "加工设备", required = true)
    private String name;

    /**
     * 级别
     */
    @NotNull(message = "分类级别不能为空")
    @Min(value = 1, message = "分类级别必须大于0")
    @ApiModelProperty(value = "分类级别", example = "1", notes = "1为一级分类，2为二级分类，以此类推", required = true)
    private Integer level;

    /**
     * 排序
     */
    @NotNull(message = "排序值不能为空")
    @Min(value = 0, message = "排序值必须大于等于0")
    @ApiModelProperty(value = "排序值", example = "1", notes = "数值越小越靠前", required = true)
    private Integer sort;
} 